package com.nxk.modules.content.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nxk.modules.content.dao.ConAboutDao;
import com.nxk.modules.content.entity.ConAbout;
import com.nxk.modules.content.service.ConAboutService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.UUID;

@Service
public class ConAboutServiceImpl extends ServiceImpl<ConAboutDao, ConAbout> implements ConAboutService {

    @Override
    @Transactional(readOnly = false)
    public boolean save(ConAbout conAbout) {
        ConAbout byId = super.getById(conAbout.getId());
        if (StringUtils.isNotBlank(conAbout.getId()) && byId != null) {
            return super.updateById(conAbout);
        } else {
            return super.save(conAbout);
        }
    }

}
